*Table A31: Re-weighted Income Summary Statistics 


* CPS Benchmarks
clear
use ${data_dir}cps_nls.dta


matrix cps_means = J(4,5,.)
su parent if is_parent==1 & cps==1 & survey==1966 & parent<6.10e+10 [w=asecwth] // 2 crazy outliers 
matrix cps_means[1,1] = r(mean)
su kid if is_kid==1 & cps==1 & survey==1966 [w=asecwth]
matrix cps_means[2,1] = r(mean)
su parent if is_parent==1 & cps==1 & survey==1979 [w=asecwth]
matrix cps_means[3,1] = r(mean)
su kid if is_kid==1 & cps==1 & survey==1979 [w=asecwth]
matrix cps_means[4,1] = r(mean)


* NLS Means
clear
use "${data_dir}DavisMazumderData.dta"
keep if age_firstSurvey<=18
drop if miss0 | miss1
drop if (mom_outOfRange==1 & linkMom==1 & !(dad_outOfRange==0 & linkDad==1)) | (dad_outOfRange==1 & linkDad==1 & !(mom_outOfRange==0 & linkMom==1)) | (linkMom==0 & linkDad==0) 

gen id = .
 replace id = id_son if survey==1966 & women==0
 replace id = id_daughter if survey==1966 & women==1
 replace id = CASEID if survey==1979

merge 1:1 id survey women using  ${data_dir}weight_adjustments.dta // Created by figureA11_A14.do
 

 * Main Sample Means
su  faminc0 if  survey==1966  [w=weight] 
matrix cps_means[1,2] = r(mean)
su  faminc1 if  survey==1966  [w=weight] 
matrix cps_means[2,2] = r(mean)
su  faminc0 if  survey==1979  [w=weight] 
matrix cps_means[3,2] = r(mean)
su  faminc1 if  survey==1979  [w=weight] 
matrix cps_means[4,2] = r(mean)


* Re-weight to match parents
su  faminc0 if  survey==1966  [w=wt_nls_parent] 
matrix cps_means[1,3] = r(mean)
su  faminc1 if  survey==1966  [w=wt_nls_parent] 
matrix cps_means[2,3] = r(mean)
su  faminc0 if  survey==1979  [w=wt_nls_parent] 
matrix cps_means[3,3] = r(mean)
su  faminc1 if  survey==1979  [w=wt_nls_parent] 
matrix cps_means[4,3] = r(mean)


* Re-weight to match kids
su  faminc0 if  survey==1966  [w=wt_nls_kid] 
matrix cps_means[1,4] = r(mean)
su  faminc1 if  survey==1966  [w=wt_nls_kid] 
matrix cps_means[2,4] = r(mean)
su  faminc0 if  survey==1979  [w=wt_nls_kid] 
matrix cps_means[3,4] = r(mean)
su  faminc1 if  survey==1979  [w=wt_nls_kid] 
matrix cps_means[4,4] = r(mean)



* Re-weight using average weight
su  faminc0 if  survey==1966  [w=wt_nls_avg]
matrix cps_means[1,5] = r(mean)
su  faminc1 if  survey==1966  [w=wt_nls_avg] 
matrix cps_means[2,5] = r(mean)
su  faminc0 if  survey==1979  [w=wt_nls_avg] 
matrix cps_means[3,5] = r(mean)
su  faminc1 if  survey==1979  [w=wt_nls_avg] 
matrix cps_means[4,5] = r(mean)

clear
svmat cps_means
outsheet using ${results_dir}tableA31.csv, comma names replace

exit










 
exit
